package com.hl.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.mapper.LingJuanZhongXinMapper;
import com.hl.domain.ShopJuan;
import com.hl.service.ILingJuanZhongXinService;

/**
 * 领券中心Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-27
 */
@Service
public class LingJuanZhongXinServiceImpl implements ILingJuanZhongXinService 
{
    @Autowired
    private LingJuanZhongXinMapper lingJuanZhongXinMapper;

    /**
     * 查询领券中心
     * 
     * @param id 领券中心主键
     * @return 领券中心
     */
    @Override
    public ShopJuan selectShopJuanById(Integer id)
    {
        return lingJuanZhongXinMapper.selectShopJuanById(id);
    }

    /**
     * 查询领券中心列表
     * 
     * @param shopJuan 领券中心
     * @return 领券中心集合
     */
    @Override
    public List<ShopJuan> selectShopJuanList(ShopJuan shopJuan)
    {
        return lingJuanZhongXinMapper.selectShopJuanList(shopJuan);
    }

    /**
     * 根据店铺ID查询领券中心
     * 
     * @param shopId 店铺ID
     * @return 领券中心集合
     */
    @Override
    public List<ShopJuan> selectShopJuanByShopId(Integer shopId)
    {
        return lingJuanZhongXinMapper.selectShopJuanByShopId(shopId);
    }

    /**
     * 根据优惠券ID查询领券中心
     * 
     * @param couponId 优惠券ID
     * @return 领券中心集合
     */
    @Override
    public List<ShopJuan> selectShopJuanByCouponId(Integer couponId)
    {
        return lingJuanZhongXinMapper.selectShopJuanByCouponId(couponId);
    }

    /**
     * 新增领券中心
     * 
     * @param shopJuan 领券中心
     * @return 结果
     */
    @Override
    public int insertShopJuan(ShopJuan shopJuan)
    {
        return lingJuanZhongXinMapper.insertShopJuan(shopJuan);
    }

    /**
     * 修改领券中心
     * 
     * @param shopJuan 领券中心
     * @return 结果
     */
    @Override
    public int updateShopJuan(ShopJuan shopJuan)
    {
        return lingJuanZhongXinMapper.updateShopJuan(shopJuan);
    }

    /**
     * 批量删除领券中心
     * 
     * @param ids 需要删除的领券中心主键集合
     * @return 结果
     */
    @Override
    public int deleteShopJuanByIds(Integer[] ids)
    {
        return lingJuanZhongXinMapper.deleteShopJuanByIds(ids);
    }

    /**
     * 删除领券中心信息
     * 
     * @param id 领券中心主键
     * @return 结果
     */
    @Override
    public int deleteShopJuanById(Integer id)
    {
        return lingJuanZhongXinMapper.deleteShopJuanById(id);
    }

    /**
     * 根据店铺ID删除领券中心
     * 
     * @param shopId 店铺ID
     * @return 结果
     */
    @Override
    public int deleteShopJuanByShopId(Integer shopId)
    {
        return lingJuanZhongXinMapper.deleteShopJuanByShopId(shopId);
    }

    /**
     * 根据优惠券ID删除领券中心
     * 
     * @param couponId 优惠券ID
     * @return 结果
     */
    @Override
    public int deleteShopJuanByCouponId(Integer couponId)
    {
        return lingJuanZhongXinMapper.deleteShopJuanByCouponId(couponId);
    }

    /**
     * 统计店铺优惠券数量
     * 
     * @param shopId 店铺ID
     * @return 数量
     */
    @Override
    public int countShopJuanByShopId(Integer shopId)
    {
        return lingJuanZhongXinMapper.countShopJuanByShopId(shopId);
    }

    /**
     * 统计优惠券被使用的店铺数量
     * 
     * @param couponId 优惠券ID
     * @return 数量
     */
    @Override
    public int countShopJuanByCouponId(Integer couponId)
    {
        return lingJuanZhongXinMapper.countShopJuanByCouponId(couponId);
    }
} 